rem dump shininglore online charactor database

@echo off

set DB_HOME=D:\opt\shininglore\sl-server\_Server_Only
set output_dir=D:\opt\shininglore\test\data

rem for /R %%i in (%DB_HOME%\*) do echo %%i
for /f "delims=" %%f in ('dir /b /a-d-h-s %DB_HOME%') do (
	call :dodump %DB_HOME%\%%f %%f
)
goto :eof



:: test size, extension and dump
:dodump
  set size=%~z1
  set ext=%~x1
  rem echo %2, %ext%
  set /a mod=%size% %% 8192
  if %mod% == 0 (
	if "%ext%" neq ".dll" (
		db_dump -d a -f %output_dir%\%2.txt %2
	)
  )
  exit /b 0